using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PearlyGates;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Media;

namespace PearlyGates
{
    class BGM : GameScreen
    {
        Song backgroundSong;
        Texture2D background;

        public override void LoadContent()
        {
            background = ScreenManager.Game.Content.Load<Texture2D>("level_1");
            backgroundSong = ScreenManager.Game.Content.Load<Song>("backgroundSongLevel");
            base.LoadContent();
        }

        public override void Update(Microsoft.Xna.Framework.GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume = 1.0f;
            MediaPlayer.Play(backgroundSong);

            ScreenManager.AddScreen(new Level1(), null);
            ExitScreen();
            
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
        }


        public override void Draw(GameTime gameTime)
        {
            ScreenManager.SpriteBatch.Begin();
            ScreenManager.SpriteBatch.Draw(background, Vector2.Zero, Color.White);
            ScreenManager.SpriteBatch.End();
            
            base.Draw(gameTime);
        }
    }
}
